﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Query>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Edit Query
</asp:Content>
<asp:Content ID="javascript" ContentPlaceHolderID="Javascript" runat="server">

    <script type="text/javascript">
        $(document).ready(function() {
            $("ul.tabs").tabs("div.panes > div", { event: 'mouseover', initialIndex: 1 });
            $(".date").dateinput({ format: 'dd/mm/yyyy' });
            if ($("#PaymentType").value != "None") {
                $("#PaymentTypeChildren").hide();
            }

            $("#PaymentType").change(function() {

                if ((this).value != "None") {
                    $("#PaymentTypeChildren").show();

                }
                else {
                    $("#PaymentTypeChildren").hide();
                    $("#Amount").val('');
                }
            });
        });
    </script>

</asp:Content>
<asp:Content ID="ContentHeader" ContentPlaceHolderID="ContentHeader" runat="server">
    Edit :
    <%= Html.DisplayTextFor(m => m.QueryType)%>
    #<%= Html.DisplayTextFor(m => m.QueryId)%>
</asp:Content>
<asp:Content ID="ContentSubNav" ContentPlaceHolderID="ContentSubNav" runat="server">
    <li class=""><%= Html.ActionLink("Create Enquiry", "Create", "Enquiry")%></li>
    <li class=""><%= Html.ActionLink("Open Enquiries", "Index", "Enquiry")%></li>
    <li class=""><%= Html.ActionLink("Completed Enquiries", "Completed", "Enquiry")%></li>
    <%--<li class=""><%= Html.ActionLink("Pending Compensation", "Pending", "Enquiry")%></li>--%>
    <li class=""><%= Html.ActionLink("Approved Compensation", "Approved", "Enquiry")%></li>
    <li class=""><%= Html.ActionLink("Declined Compensation", "Declined", "Enquiry")%></li>
    <li class=""><%= Html.ActionLink("Complaints Alert", "ComplaintsAlert", "Enquiry")%></li>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <p>Please edit the query...</p>
    <a href="<%=Request.UrlReferrer != null ? Request.UrlReferrer.ToString() : Url.Action("Index")%>"><< Go back</a> 
    
    <%= Html.ValidationSummary(true, "There were some errors with your form. Please correct and try again") %>
    <% using (Html.BeginForm("Edit", "Enquiry", FormMethod.Post, new { id = "EnquiryForm", @class = "faux_form" }))
       {%>
    <ul class="tabs">
        <li><a href="#tabs-1">Contact Details</a></li>
        <li><a href="#tabs-2">Query Details</a></li>
        <li><a href="#tabs-3">Resolution</a></li>
    </ul>
    <div class="panes">
        <div class="pane">
            <%--USER INFO--%>
            <div class="formRegion">
                <div>
                    <%= Html.LabelFor(m => m.FirstName)%>
                    <%= Html.TextBoxFor(m => m.FirstName, new {@class = "text"}) %>
                    <%= Html.ValidationMessageFor(m => m.FirstName) %>
                </div>
                <div>
                    <%= Html.LabelFor(m => m.LastName)%>
                    <%= Html.TextBoxFor(m => m.LastName, new { @class = "text" })%>
                    <%= Html.ValidationMessageFor(m => m.LastName)%>
                </div>
                <div>
                    <%= Html.LabelFor(m => m.Email)%>
                    <%= Html.TextBoxFor(m => m.Email, new {@class = "text"}) %>
                    <%= Html.ValidationMessageFor(m => m.Email)%>
                </div>
                <div>
                    <%= Html.LabelFor(m => m.Telephone)%>
                    <%= Html.TextBoxFor(m => m.Telephone, new {@class = "text"}) %>
                    <%= Html.ValidationMessageFor(m => m.Telephone)%>
                </div>
            </div>
            <div class="formRegion">
                <div>
                    <%= Html.LabelFor(m => m.AddressLine1)%>
                    <%= Html.TextBoxFor(m => m.AddressLine1, new {@class = "text"}) %>
                    <%= Html.ValidationMessageFor(m => m.AddressLine1)%>
                </div>
                <div>
                    <%= Html.LabelFor(m => m.AddressLine2)%>
                    <%= Html.TextBoxFor(m => m.AddressLine2, new {@class = "text"}) %>
                    <%= Html.ValidationMessageFor(m => m.AddressLine2)%>
                </div>
                <div>
                    <%= Html.LabelFor(m => m.Town)%>
                    <%= Html.TextBoxFor(m => m.Town, new {@class = "text"}) %>
                    <%= Html.ValidationMessageFor(m => m.Town)%>
                </div>
                <div>
                    <%= Html.LabelFor(m => m.County)%>
                    <%= Html.TextBoxFor(m => m.County, new {@class = "text"}) %>
                    <%= Html.ValidationMessageFor(m => m.County)%>
                </div>
                <div>
                    <%= Html.LabelFor(m => m.PostCode)%>
                    <%= Html.TextBoxFor(m => m.PostCode, new { @class = "text" })%>
                    <%= Html.ValidationMessageFor(m => m.PostCode)%>
                </div>
                <div>
                    <%= Html.LabelFor(m => m.Country)%>
                    <%= Html.TextBoxFor(m => m.Country, new {@class = "text"}) %>
                    <%= Html.ValidationMessageFor(m => m.Country)%>
                </div>
            </div>
        </div><%--<<<tab1--%>
        <div class="pane">
            <div class="formRegion">
                <div>
                    <%--SOURCES--%>
                    <%= Html.LabelFor(m => m.Source)%>
                    <%= Html.DropDownListFor(m => m.Source,
                            SelectListHelpers.GetSelectListFromEnum<Query.QuerySource>(),
                            "Choose an option",
                            new { @class = "text required" })%>
                    <%= Html.ValidationMessageFor(m => m.SourceId)%>
                </div>
                <div id="retailerDiv">
                    <%--Retailers--%>
                    <%= Html.LabelFor(m => m.Retailer)%>
                    <%= Html.DropDownListFor(m => m.Retailer,
                                SelectListHelpers.GetSelectListFromEnum<Query.Retailers>(),
                                "Choose an option",
                                new { @class = "text required" })%>
                        <%= Html.ValidationMessageFor(m => m.Retailer)%>
                </div>
                 <%--DATE--%>
                    <div>
                        <%= Html.LabelFor(m => m.EnquiryDate)%>
                        <%= Html.TextBoxFor(m => m.EnquiryDate, new { @class = "text date required" })%>
                        <%= Html.ValidationMessageFor(m => m.EnquiryDate)%>
                    </div>
                                
                    <%--PRIORITY--%>
                    <div>
                        <%= Html.LabelFor(m => m.Priority)%>
                        <%= Html.DropDownListFor(m => m.Priority, new[]{
                            new SelectListItem{Text = "1", Value = "1"},
                            new SelectListItem{Text = "2",Value = "2"},
                            new SelectListItem{Text = "3",Value = "3"}
                        }, "Set the priority", new { @class = "text required" }  
                         ) %>
                        <%= Html.ValidationMessageFor(m => m.Priority)%>
                    </div>
            </div> 
            <div id="drilldowns" class="formRegion">
                <% Html.RenderPartial("Partial/DrillDown", new SpotlessWeb.Models.QueryDrillDownViewModel() { AllowEdit = true, Query = Model, DrillDowns = new DrillDown[0] }); %>
            </div>
              <div>
                        <%= Html.LabelFor(m => m.BatchCode)%>
                        <%= Html.TextBoxFor(m => m.BatchCode, new {@class = "text"}) %>
                        <%= Html.ValidationMessageFor(m => m.BatchCode)%>
                    </div>
            <div id="WmDiv" class="formRegion">
                    <div>
                    <%--WmManufacturere--%>
                        <%= Html.LabelFor(m => m.WmManufacturere)%>
                        <%= Html.DropDownListFor(m => m.WmManufacturere,
                                SelectListHelpers.GetSelectListFromEnum<Query.WmManufacturers>(),
                                "Choose an option",
                                new { @class = "text" })%>
                        <%= Html.ValidationMessageFor(m => m.WmManufacturere)%>
                    </div>
                    <%--DATE--%>
                    <div>
                        <%= Html.LabelFor(m => m.WmModel)%>
                        <%= Html.TextBoxFor(m => m.WmModel, new { @class = "" })%>
                        <%= Html.ValidationMessageFor(m => m.WmModel)%>
                    </div>
                </div>
        </div><%--<<<tab2--%>
        <div class="pane">
                <div class="formRegion">
                    <div id="" class="childrenHolder">
                        <div>
                            <%--METHOD--%>
                            <%= Html.LabelFor(m => m.Method)%><%= Html.DropDownListFor(m => m.Method, SelectListHelpers.GetSelectListFromEnum<Query.Methods>(), "Set the Method", new { @class = "text required" })%>
                            <%= Html.ValidationMessageFor(m => m.Method)%>
                        </div>
                        <div>
                            <%--PAYMENT--%>
                            <%= Html.LabelFor(m => m.PaymentType)%>
                            <%= Html.DropDownListFor(m => m.PaymentType, SelectListHelpers.GetSelectListFromEnum<Query.PaymentTypes>(), null, new { @class = "text required" })%>
                            
                            <%= Html.ValidationMessageFor(m => m.PaymentType)%>
                        </div>
                        <div id="PaymentTypeChildren" class="childrenHolder">
                            <div>
                                <%--AMOUNT--%>
                                <%= Html.LabelFor(m => m.Amount)%>
                                <%= Html.TextBoxFor(m => m.Amount, new { @class = "text" })%>
                                <%= Html.ValidationMessageFor(m => m.Amount)%>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="formRegion">
                    <div>
                        <%--STATUS--%>
                        <%= Html.LabelFor(m => m.Status)%>
                        <%= Html.DropDownListFor(m => m.Status, SelectListHelpers.GetSelectListFromEnum<Query.QueryStatus>(), null, new { @class = "text required" })%>
                        <%= Html.ValidationMessageFor(m => m.Status)%>
                    </div>
                </div>
                
            </div><%--<<<tab3--%>
        </div><%--<<<panes/tabs end--%>
    
    <div>
        <%--FREETEXT--%>
        <%= Html.Label("FreeTextArea")%>
        <%= Html.TextArea("FreeTextArea", null, new { @class = "textarea", cols = 10, rows = 4 })%>
    </div>
    <div style="border: 0;">
        <input type="submit" class="submit" value="ENTER" />
    </div>
<% } %>
</asp:Content>
